<include file="Public/header" />
<include file="Public/menu" />

<!-- 内容页 -->
<div class="content-wrapper">
    <!-- 面包屑 -->
    <section class="content-header">
        <h1>
        领券中心
        <small>管理</small>
    </h1>
        <ol class="breadcrumb">
            <li><a href="{:U('Giftcode/index')}"><i class="fa fa-dashboard"></i> 营销</a></li>
            <li class="active">领券中心</li>
        </ol>
    </section>

    <!-- 内容 -->
    <section class="content">

        <div class="row"><div class="col-md-12"><div class="nav-tabs-custom">
            <!--<ul class="nav nav-tabs">-->
                <!--<li class="<?php echo empty($_GET['type']) ? 'active': '';?>"><a href="/Admin/Giftcode/index">进行中</a></li>-->
                <!--<li class="<?php echo $_GET['type'] == 'timeout' ? 'active': '';?>"><a href="/Admin/Giftcode/index/type/timeout">已失效</a></li>-->


                <!--<li class="pull-right header"></li>-->
            <!--</ul>-->
            <div class="tab-content">
                <div class="box-header">
                    <h3 class="box-title"></h3>
                    <div class="text-danger" style="line-height: 1.8; padding: 7px; font-size: 14px;border-top:1px solid #f4f4f4; ">提示：请复制链接【/NewUserCoupon/index/local_id/<?php echo session('userInfo')['local_id'];?>】 到 【首页管理】-【图标栏目管理】</div>
                    <div class="btn-group pull-left" style="margin-right: 10px">
                        <a href="/admin/Giftcode/add" class="btn btn-sm btn-success"><i class="fa fa-save"></i>&nbsp;&nbsp;添加领取券包</a>
                    </div>

                    <!--<div class="form-inline pull-right">
                        <form action="/Admin/purchase/shoppingList/view/0/order_field/last_modify/order/asc" method="get" pjax-container="">
                            <fieldset>
                                <div class="input-group input-group-sm">
                                    <span class="input-group-addon"><strong>名称</strong></span>
                                    <input type="hidden" name="search_field" value="local_name">
                                    <input type="text" class="form-control" placeholder="搜索" name="search" value="">
                                </div>
                                <div class="input-group input-group-sm">
                                    <div class="input-group-btn">
                                        <button type="submit" class="btn btn-primary"><i class="fa fa-search"></i></button>
                                    </div>
                                </div>
                            </fieldset>
                        </form>
                    </div>-->
                </div>

                <div class="tab-pane active" id="tab_0">
                    <div class="box">

                        <!-- /.box-header -->
                        <div class="box-body table-responsive no-padding">
                            <table class="table table-hover" style="width: 100%;">
                                <tbody><tr>
                                    <th></th>
                                    <th>
                                        ID<a class="fa fa-fw fa-sort" href="{:U('Giftcode/index',array('order'=>$order), '')}"></a>
                                    </th>
                                    <th>领取类型</th>
                                    <th>领取名称</th>
                                    <th>启动状态</th>
                                    <th>开始时间</th>
                                    <th>结束时间</th>
                                    <th>创建时间</th>
                                    <th>图片</th>
                                    <th>操作</th>
                                </tr>
                                <foreach name="giftcode_msg" item="v">
                                    <tr>
                                        <td></td>
                                        <td>{$v.id}</td>
                                        <td>{$v.type}</td>
                                        <td>{$v.name}</td>
                                        <td><if condition="$v['status'] == 1">开启<else />关闭</if></td>
                                        <td>{$v.first_time}</td>
                                        <td>{$v.last_time}</td>
                                        <td>{$v.create_time}</td>
                                        <td><img style="width: 100px" src="{$v.img}"></td>
                                        <td>
                                            <?php if (empty($_GET['type'])){ ?>
                                            <a href="/Admin/Giftcode/update/id/<?php echo $v['id'];?>" class="btn btn-sm btn-primary">修改</a>
                                            <?php } ?>
                                            <!--<a onclick="if(confirm('确定删除?')==false)return false;" href="/Admin/Giftcode/delete/id/{$v.id}" class="btn btn-sm btn-danger grid-refreshe">删除</a>-->
                                        </td>
                                    </tr>
                                </foreach>
                                </tbody>
                            </table>
                        </div>
                        <div class="box-footer clearfix">
                            <!--<input type="checkbox" class="grid-select-all">&nbsp;&nbsp;&nbsp;-->
                            <!--<a class="btn btn-sm btn-danger batch-delete">批量删除</a>-->

                            <!--<a class="btn btn-sm btn-primary grid-refresh"><i class="fa fa-refresh"></i></a>-->

                            <ul class="pagination pagination-sm no-margin pull-right">    </ul>
                            {$show}
                        </div>
                        <!-- /.box-body -->
                    </div>

                </div>

                <div class="tab-pane " id="tab_">
                    <div class="box">
                        <div class="box-body table-responsive no-padding">
                        </div>
                    </div>
                </div>


            </div>
        </div></div></div>

    </section>
</div>
<!-- 底部 -->
<include file="Public/common_footer" />
<script src="/Public/layer/layer.js"></script>
<script>
    $('.exchange-code').click(function () {
        var href = $(this).attr('href-data');
        layer.ready(function(){
            layer.open({
                type: 2,
                title: '添加产品列表',
                fix: false,
                maxmin: true,
                shadeClose: true,
                area: ['1100px', '800px'],
                content: href,
                end: function(){
                    layer.tips('Hi', '#about', {tips: 1})
                }
            });
        });
    });
</script>

